home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / bash_114.zip / bash-1.14.2 / cpp-Makefile < prev    next >
Makefile  |  1994-08-12  |  58KB  |  1,545 lines

  1. /* This -*- C -*- file (cpp-Makefile) is run through the C preprocessor
  2.    to produce bash-Makefile which is machine specific.
  3.  
  4.    If you have Gcc and/or Bison, you might wish to mention that right
  5.    below here.
  6.  
  7.    Since this is to become a Makefile, blank lines which appear outside
  8.    of comments may not contain a TAB character.
  9.  
  10.    Copyright (C) 1987,1991 Free Software Foundation, Inc.
  11.  
  12.    This file is part of GNU Bash, the Bourne Again SHell.
  13.  
  14.    Bash is free software; you can redistribute it and/or modify it under
  15.    the terms of the GNU General Public License as published by the Free
  16.    Software Foundation; either version 1, or (at your option) any later
  17.    version.
  18.  
  19.    Bash is distributed in the hope that it will be useful, but WITHOUT ANY
  20.    WARRANTY; without even the implied warranty of MERCHANTABILITY or
  21.    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  22.    for more details.
  23.  
  24.    You should have received a copy of the GNU General Public License along
  25.    with Bash; see the file COPYING.  If not, write to the Free Software
  26.    Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  27.  
  28. /**/# This Makefile is automagically made from cpp-Makefile.  You should
  29. /**/# not be editing this file; edit cpp-Makefile, machines.h, or
  30. /**/# support/mksysdefs instead.  Then, assuming the edits were required
  31. /**/# to compile Bash on your system, mail the changes you had to make to
  32. /**/# bash-maintainers@prep.ai.mit.edu.  We will do our best to incorporate
  33. /**/# them into the next release.
  34.  
  35. /**/# Make sure the first target in the makefile is the right one
  36. all: .made
  37.  
  38. /* **************************************************************** */
  39. /*                                    */
  40. /*            Which compiler are you using?            */
  41. /*                                    */
  42. /* **************************************************************** */
  43.  
  44. /* Define HAVE_GCC if you have the GNU C compiler. */
  45. /* #define HAVE_GCC */
  46.  
  47. #if defined (__GNUC__) && !defined (HAVE_GCC) && !defined (NeXT)
  48. #  define HAVE_GCC
  49. #endif
  50.  
  51. /* Undefine HAVE_FIXED_INCLUDES if you are not using GCC with the fixed
  52.    header files. */
  53. #if defined (HAVE_GCC) && !defined (HAVE_FIXED_INCLUDES)
  54. #  define HAVE_FIXED_INCLUDES
  55. #endif /* HAVE_GCC && !HAVE_FIXED_INCLUDES */
  56.  
  57. /* Define HAVE_BISON if you have the GNU replacement for Yacc. */
  58. /**/# We would like you to use Bison instead of Yacc since some
  59. /**/# versions of Yacc cannot handle reentrant parsing.  Unfortunately,
  60. /**/# this includes the Yacc currently being shipped with SunOS4.x.
  61. /**/# If you do use Yacc, please make sure that any bugs in parsing
  62. /**/# are not really manifestations of Yacc bugs before you report
  63. /**/# them.
  64. /* #define HAVE_BISON */
  65.  
  66. /* Include some boilerplate Gnu makefile definitions. */
  67. prefix = /usr/local
  68.  
  69. /**/#prefix = @prefix@
  70.  
  71. exec_prefix = $(prefix)
  72. bindir = $(exec_prefix)/bin
  73. libdir = $(exec_prefix)/lib
  74.  
  75. manroot = $(prefix)/man
  76.  
  77. man1ext = 1
  78. man1dir = $(manroot)/man$(man1ext)
  79. man3ext = 3
  80. man3dir = $(manroot)/man$(man3ext)
  81. mandir = $(man1dir)
  82. manext = $(man1ext)
  83.  
  84. infodir = $(prefix)/info
  85.  
  86. srcdir = .
  87. /**/#srcdir = @srcdir@
  88.  
  89. VPATH = .:$(srcdir)
  90.  
  91. /**/#incdir = @incdir@
  92.  
  93. /* If you have purify, and want to use it, uncomment this definition or
  94.    run the make as `make -f bash-Makefile bash PURIFY=purify'. */
  95. PURIFY = # purify
  96.  
  97. /* This includes the appropriate description for the machine that you are
  98.    using (we hope).  If the compilation doesn't work correctly, then you
  99.    will have to edit the file `machines.h' to include a description for the
  100.    machine that your Cpp uniquely identifies this as.  For example, Sun 4's
  101.    are recognized by the Cpp identifier `sparc', Vax is recognized with `vax',
  102.    etc.  The order of these files is very important.  Config.h must come last,
  103.    since it is capable of undef'ing various things. */
  104. #define BUILDING_MAKEFILE   /* Tell config.h to avoid #including anything. */
  105. #include "sysdefs.h"
  106. #include "machines.h"
  107. #include "config.h"
  108.  
  109. /* Can't use the Gnu malloc library without saying we want the Gnu malloc. */
  110. #if !defined (USE_GNU_MALLOC)
  111. #  undef USE_GNU_MALLOC_LIBRARY
  112. #endif /* !USE_GNU_MALLOC */
  113.  
  114. .SUFFIXES: .aux
  115. /**/# Here is a rule for making .o files from .c files that does not
  116. /**/# force the type of the machine (like -M_MACHINE) into the flags.
  117. .c.o:
  118.     $(RM) $@
  119.     $(CC) $(CCFLAGS) $(CPPFLAGS) -c $<
  120.  
  121. .c.aux:
  122.     $(RM) $@
  123.     $(CC) $(CCFLAGS) $(CPPFLAGS) -o $@ $<
  124.  
  125. #if defined (HAVE_BISON)
  126. BISON = bison -y
  127. #else
  128. BISON = yacc
  129. #endif
  130.  
  131. #if defined (HAVE_GCC)
  132. #  if defined (GCC_FLAGS)
  133. GCC_EXTRAS = GCC_FLAGS
  134. #  endif /* GCC_FLAGS */
  135. #  if !defined (HAVE_FIXED_INCLUDES)
  136. /* This is guaranteed to work, even if you have the fixed includes!
  137.    (Unless, of course, you have the fixed include files installed in
  138.    /usr/include.  Then it will break.) */
  139. CC = gcc -traditional -I/usr/include $(GCC_EXTRAS)
  140. #  else /* HAVE_FIXED_INCLUDES */
  141. CC = gcc $(GCC_EXTRAS)
  142. #  endif /* HAVE_FIXED_INCLUDES */
  143. #else /* !HAVE_GCC */
  144. CC = CPP_CC
  145. #endif /* !HAVE_GCC */
  146.  
  147. /**/# If the user has specified a Make shell, then use that.
  148. #if defined (MAKE_SHELL)
  149. SHELL = MAKE_SHELL
  150. #else
  151. SHELL=/bin/sh
  152. #endif /* MAKE_SHELL */
  153.  
  154. CP = cp
  155. RM = rm -f
  156. AR = ar
  157.  
  158. INSTALL_PROGRAM = install -c
  159. INSTALL_DATA = install -c -m 644
  160.  
  161. COMPRESS = gzip
  162. COMPRESS_EXT = .gz
  163.  
  164. Machine = M_MACHINE
  165. OS = M_OS
  166.  
  167. /**/# PROFILE_FLAGS is either -pg, to generate profiling info for use
  168. /**/# with gprof, or nothing (the default).
  169. PROFILE_FLAGS=
  170.  
  171. #if defined (SYSDEP_CFLAGS)
  172. /**/# This system has some peculiar flags that must be passed to the
  173. /**/# the C compiler (or to cpp).
  174. SYSDEP = SYSDEP_CFLAGS
  175. #endif /* SYSDEP_CFLAGS */
  176.  
  177. #if defined (SYSDEP_LDFLAGS)
  178. /**/# This system has some peculiar flags that must be passed to the
  179. /**/# link editor (ld).
  180. SYSDEP_LD = SYSDEP_LDFLAGS
  181. #endif /* SYSDEP_LDFLAGS */
  182.  
  183. #if defined (HAVE_SETLINEBUF)
  184. /**/# This system has the setlinebuf () call.
  185. LINEBUF = -DHAVE_SETLINEBUF
  186. #endif
  187.  
  188. #if defined (HAVE_VFPRINTF)
  189. /**/# This system has the vprintf () and vfprintf () calls.
  190. VPRINTF = -DHAVE_VFPRINTF
  191. #endif /* HAVE_VFPRINTF */
  192.  
  193. #if defined (USE_VFPRINTF_EMULATION)
  194. VPRINTF = -DHAVE_VFPRINTF
  195. VPRINT_OBJ = vprint.o
  196. #endif /* USE_VFPRINTF_EMULATION */
  197.  
  198. #if defined (HAVE_SYS_STREAM_H)
  199. /**/# This system has <sys/stream.h>
  200. STREAM = -DHAVE_SYS_STREAM_H
  201. #endif /* HAVE_SYS_STREAM_H */
  202.  
  203. #if defined (HAVE_SYS_PTEM_H)
  204. /**/# This system has <sys/ptem.h>
  205. PTEM = -DHAVE_SYS_PTEM_H
  206. #endif /* HAVE_SYS_PTEM_H */
  207.  
  208. #if defined (HAVE_SYS_PTE_H)
  209. /**/# This system has <sys/pte.h>
  210. PTE = -DHAVE_SYS_PTE_H
  211. #endif /* HAVE_SYS_PTE_H */
  212.  
  213. /**/# This system has <unistd.h>.
  214. #if defined (HAVE_UNISTD_H)
  215. UNISTD = -DHAVE_UNISTD_H
  216. #endif
  217.  
  218. /**/# This system has <stdlib.h>
  219. #if defined (HAVE_STDLIB_H)
  220. STDLIB = -DHAVE_STDLIB_H
  221. #endif
  222.  
  223. /**/# This system has <limits.h>
  224. #if defined (HAVE_LIMITS_H)
  225. LIMITSH = -DHAVE_LIMITS_H
  226. #endif
  227.  
  228. #if defined (HAVE_GETGROUPS)
  229. /**/# This system has multiple groups.
  230. GROUPS = -DHAVE_GETGROUPS
  231. #endif
  232.  
  233. #if defined (HAVE_RESOURCE)
  234. /**/# This system has <sys/resource.h>
  235. RESOURCE = -DHAVE_RESOURCE
  236. #endif
  237.  
  238. #if defined (HAVE_SYS_PARAM)
  239. /**/# This system has <sys/param.h>
  240. PARAM = -DHAVE_SYS_PARAM
  241. #endif
  242.  
  243. #if defined (VOID_SIGHANDLER)
  244. /**/# The signal () call provided by the system returns a pointer to
  245. /**/# a function returning void.  The signal handlers themselves are
  246. /**/# thus void functions.
  247. SIGHANDLER = -DVOID_SIGHANDLER
  248. #endif
  249.  
  250. #if defined (HAVE_STRERROR)
  251. /**/# This system has the strerror () function.
  252. STRERROR = -DHAVE_STRERROR
  253. #endif
  254.  
  255. #if defined (HAVE_WAIT_H)
  256. /**/# This system has <sys/wait.h>
  257. WAITH = -DHAVE_WAIT_H
  258. #endif
  259.  
  260. #if defined (HAVE_GETWD)
  261. /**/# This system has the getwd () call.
  262. GETWD = -DHAVE_GETWD
  263. #endif
  264.  
  265. #if defined (HAVE_DUP2)
  266. /**/# This system has a working version of dup2 ().
  267. DUP2 = -DHAVE_DUP2
  268. #endif /* HAVE_DUP2 */
  269.  
  270. #if defined (HAVE_DIRENT)
  271. /**/# This system uses struct dirent for reading directories with readdir.
  272. DIRENT = -DHAVE_DIRENT
  273. #endif /* HAVE_DIRENT */
  274.  
  275. #if defined (HAVE_DIRENT_H)
  276. /**/# This system has /usr/include/dirent.h
  277. DIRENTH = -DHAVE_DIRENT_H
  278. #endif /* HAVE_DIRENT_H */
  279.  
  280. #if defined (HAVE_STRING_H)
  281. /**/# This system has /usr/include/string.h
  282. STRINGH = -DHAVE_STRING_H
  283. #endif /* HAVE_STRING_H */
  284.  
  285. #if defined (HAVE_VARARGS_H)
  286. /**/# This system has /usr/include/varargs.h
  287. VARARGSH = -DHAVE_VARARGS_H
  288. #endif /* HAVE_VARARGS_H */
  289.  
  290. #if defined (HAVE_STRCHR)
  291. /**/# This system has strchr () and strrchr () string functions.
  292. STRCHR = -DHAVE_STRCHR
  293. #endif /* HAVE_STRCHR */
  294.  
  295. #if defined (HAVE_STRCASECMP)
  296. STRCASE = -DHAVE_STRCASECMP
  297. #endif /* HAVE_STRCASECMP */
  298.  
  299. #if defined (HAVE_DEV_FD)
  300. /**/# This system has the /dev/fd directory for naming open files.
  301. DEVFD = -DHAVE_DEV_FD
  302. #endif /* HAVE_DEV_FD */
  303.  
  304. /**/# The GNU coding standards don't recognize the possibility that
  305. /**/# other information besides optimization and debugging might be
  306. /**/# passed to cc.  A different name should have been used.
  307. CFLAGS = -O -g
  308.  
  309. SYSTEM_FLAGS = $(LINEBUF) $(VPRINTF) $(UNISTD) $(STDLIB) $(LIMITSH) \
  310.        $(GROUPS) $(RESOURCE) $(PARAM) $(SIGHANDLER) $(SYSDEP) $(WAITH) \
  311.        $(GETWD) $(DUP2) $(STRERROR) $(DIRENT) $(DIRENTH) $(STRINGH) \
  312.        $(VARARGSH) $(STRCHR) $(STRCASE) $(DEVFD) \
  313.        -D$(Machine) -D$(OS)
  314. LDFLAGS    = $(NOSHARE) $(SYSDEP_LD) $(EXTRA_LD_PATH) $(PROFILE_FLAGS) $(CFLAGS)
  315. CCFLAGS    = $(PROFILE_FLAGS) $(CFLAGS) $(SYSTEM_FLAGS) -DSHELL $(ALLOCA_CFLAGS) \
  316.       $(MALLOC_CFLAGS)
  317. CPPFLAGS= -I. -I$(srcdir) -I$(LIBSRC)
  318. GCC_LINT_FLAGS = -ansi -Wall -Wshadow -Wpointer-arith -Wcast-qual \
  319.          -Wwrite-strings -Werror -Wstrict-prototypes \
  320.          -Wmissing-prototypes
  321. GCC_LINT_CFLAGS = $(PROFILE_FLAGS) $(CFLAGS) $(SYSTEM_FLAGS) -DSHELL $(ALLOCA_CFLAGS) \
  322.           $(MALLOC_CFLAGS) $(GCC_LINT_FLAGS)
  323.  
  324. /* It is conceivable that you wish to edit some things beyond this point,
  325.    but I guess that it is highly unlikely, and may give you a headache. */
  326.  
  327. /* **************************************************************** */
  328. /*                                    */
  329. /*            How to Build the support libraries.            */
  330. /*                                    */
  331. /* **************************************************************** */
  332.  
  333. /**/# The location of sources for the support libraries.
  334. LIBPATH = ./lib/
  335. LIBSRC = $(srcdir)/$(LIBPATH)
  336.  
  337. /**/# Preface building with the full path of the current library source.
  338. LIBINC_DECL  = topdir=`sh $(srcdir)/support/srcdir $(srcdir)`; export topdir
  339. LIBINC_USAGE = "-I$${topdir} -I$${topdir}/$(LIBPATH) -I$(LIBSRC)"
  340.  
  341. /* Defines used when building libraries. */
  342. #define LIB_CFLAGS_DECL CFLAGS='$(LIBRARY_CFLAGS) '$(LIBINC_USAGE)
  343. #define LIB_CPPFLAGS_DECL CPPFLAGS='$(CPPFLAGS)'
  344. #define LIB_LDFLAGS_DECL LDFLAGS='$(LDFLAGS)'
  345. #define LIBMAKE_FLAGS LIB_CFLAGS_DECL LIB_CPPFLAGS_DECL LIB_LDFLAGS_DECL \
  346.     RANLIB='$(RANLIB)' AR='$(AR)' CC='$(CC)' RM='$(RM)' \
  347.  
  348. /* Macro used to build a library. */
  349. #define build_lib_in_dir(directory, target, srcdef, makefile) \
  350.     @echo "Building in " directory "..."; \
  351.     sh $(SUPPORT_SRC)mkdirs directory ; \
  352.     ($(LIBINC_DECL); cd directory; \
  353.      if [ ! -f Makefile ]; then cp makefile Makefile; fi; \
  354.      $(MAKE) target $(MFLAGS) LIBMAKE_FLAGS srcdef)
  355.  
  356. /* The builtins are somewhat special in that more information is needed
  357.    to compile them correctly. */
  358. #define build_builtins(target) \
  359.     @sh $(SUPPORT_SRC)mkdirs $(DEFDIR) ; \
  360.     ($(LIBINC_DECL); cd $(DEFDIR); \
  361.      if [ ! -f Makefile ]; then \
  362.         cp $(BUILTIN_ABSSRC)/Makefile Makefile; \
  363.      fi; \
  364.      $(MAKE) $(MFLAGS) target \
  365.      srcdir=$(BUILTIN_ABSSRC) CPPFLAGS='$(CPPFLAGS)' \
  366.      CFLAGS='$(CCFLAGS) '$(LIBINC_USAGE)' -I. -I$(BUILTIN_ABSSRC)' \
  367.      LDFLAGS='$(LDFLAGS)' RANLIB='$(RANLIB)' AR='$(AR)' CC='$(CC)' \
  368.      RM='$(RM)' RL_LIBSRC='$(RL_ABSSRC)' \
  369.      DIRECTDEFINE='-D '$(srcdir)/$(DEFDIR))
  370.  
  371. /**/# Flags used when building libraries.
  372. LIBRARY_CFLAGS  = $(PROFILE_FLAGS) $(CFLAGS) $(SIGHANDLER) $(ALLOCA_CFLAGS) \
  373.           $(SYSDEP) $(DIRENT) $(DIRENTH) $(STRINGH) $(VARARGSH) \
  374.           $(PTEM) $(PTE) $(STREAM) $(STRERROR) $(RESOURCE) \
  375.           $(STRCHR) -D$(Machine) -D$(OS) $(UNISTD) $(LIMITSH) \
  376.           $(STRCASE) $(STDLIB) -DSHELL
  377.  
  378. /**/# These are required for sending bug reports.
  379. SYSTEM_NAME = $(Machine)
  380. OS_NAME = $(OS)
  381.  
  382. /**/# The name of this program.
  383. Program = bash
  384.  
  385. /**/# The type of machine and OS Bash is being compiled on.
  386. HOSTTYPE_DECL = -DHOSTTYPE='$(SYSTEM_NAME)' -DOSTYPE='$(OS_NAME)'
  387.  
  388. MAINTAIN_DEFINE = -DMAINTAINER='"bug-bash@prep.ai.mit.edu"'
  389.  
  390. /**/# The group of configuration flags.  These are for shell.c
  391. CFG_FLAGS = -DOS_NAME='$(OS_NAME)' -DProgram=$(Program) \
  392.         -DSYSTEM_NAME='$(SYSTEM_NAME)' $(SIGLIST_FLAG) $(MAINTAIN_DEFINE)
  393.  
  394. /* **************************************************************** */
  395. /*                                                                  */
  396. /*                 Support for desired libraries.                   */
  397. /*    This includes Termcap, Glob, Tilde, History, and Readline.    */
  398. /*                                                                  */
  399. /* **************************************************************** */
  400.  
  401. /* Does this machine's linker need a space after -L? */
  402. #if defined (HAVE_GCC)
  403. #  undef SEARCH_LIB_NEEDS_SPACE
  404. #endif /* HAVE_GCC */
  405.  
  406. #if defined (SEARCH_LIB_NEEDS_SPACE)
  407. /**/# The native compiler for this machines requires a space after '-L'.
  408. SEARCH_LIB = -L $(UNSET_VARIABLE_CREATES_SPACE)
  409. #else
  410. /**/# The compiler being used to build Bash can handle -L/library/path.
  411. SEARCH_LIB = -L
  412. #endif /* !SEARCH_LIB_NEEDS_SPACE */
  413.  
  414. #if defined (EXTRA_LIB_SEARCH_PATH)
  415. /**/# Additional instructions to the linker telling it how to find libraries.
  416. LOCAL_LD_PATH = EXTRA_LIB_SEARCH_PATH
  417. EXTRA_LD_PATH = $(SEARCH_LIB)$(LOCAL_LD_PATH)
  418. #endif /* EXTRA_LIB_SEARCH_PATH */
  419.  
  420. /* Right now we assume that you have the full source code to Bash.  If
  421.    you simply have the library and header files installed, then
  422.    undefine HAVE_READLINE_SOURCE. */
  423. #define HAVE_READLINE_SOURCE
  424.  
  425. #if defined (HAVE_READLINE_SOURCE)
  426.  
  427. RL_LIBSRC = $(LIBSRC)readline/
  428. RL_LIBDOC = $(RL_LIBSRC)doc/
  429. RL_LIBDIR = $(LIBPATH)readline/
  430. RL_ABSSRC = $${topdir}/$(RL_LIBDIR)
  431.  
  432. READLINE_LIBRARY = $(RL_LIBDIR)libreadline.a
  433.  
  434. /**/# The source, object and documentation of the GNU Readline library.
  435. READLINE_SOURCE    = $(RL_LIBSRC)rldefs.h $(RL_LIBSRC)rlconf.h \
  436.           $(RL_LIBSRC)readline.h \
  437.           $(RL_LIBSRC)chardefs.h $(RL_LIBSRC)keymaps.h \
  438.           $(RL_LIBSRC)funmap.c $(RL_LIBSRC)emacs_keymap.c \
  439.           $(RL_LIBSRC)search.c $(RL_LIBSRC)vi_keymap.c \
  440.           $(RL_LIBSRC)keymaps.c $(RL_LIBSRC)parens.c \
  441.           $(RL_LIBSRC)vi_mode.c $(RL_LIBSRC)history.c \
  442.           $(RL_LIBSRC)readline.c $(RL_LIBSRC)tilde.c \
  443.           $(RL_LIBSRC)rltty.c $(RL_LIBSRC)complete.c \
  444.           $(RL_LIBSRC)bind.c $(RL_LIBSRC)isearch.c \
  445.           $(RL_LIBSRC)display.c $(RL_LIBSRC)signals.c \
  446.           $(RL_LIBSRC)posixstat.h $(RL_LIBSRC)tilde.h \
  447.           $(RL_LIBSRC)xmalloc.c
  448.  
  449. READLINE_OBJ    = $(RL_LIBDIR)readline.o $(RL_LIBDIR)funmap.o \
  450.           $(RL_LIBDIR)parens.o $(RL_LIBDIR)search.o \
  451.           $(RL_LIBDIR)keymaps.o $(RL_LIBDIR)history.o \
  452.           $(RL_LIBDIR)rltty.o $(RL_LIBDIR)complete.o \
  453.           $(RL_LIBDIR)bind.o $(RL_LIBDIR)isearch.o \
  454.           $(RL_LIBDIR)display.o $(RL_LIBDIR)signals.o \
  455.           $(RL_LIBDIR)tilde.o $(RL_LIBDIR)xmalloc.o
  456.  
  457. READLINE_DOC    = $(RL_LIBDOC)rlman.texinfo $(RL_LIBDOC)rluser.texinfo \
  458.           $(RL_LIBDOC)rltech.texinfo
  459.  
  460. READLINE_DOC_SUPPORT  = $(RL_LIBDOC)Makefile $(RL_LIBDOC)readline.dvi \
  461.           $(RL_LIBDOC)readline.info
  462.  
  463. /**/# This has to be written funny to avoid looking like a C comment starter.
  464. READLINE_EXAMPLES = $(RL_LIBSRC)examples/[a-zA-Z]*.[ch] \
  465.             $(RL_LIBSRC)examples/Makefile $(RL_LIBSRC)examples/Inputrc
  466.  
  467. /**/# Support files for GNU Readline.
  468. READLINE_SUPPORT = $(RL_LIBSRC)Makefile $(RL_LIBSRC)ChangeLog \
  469.            $(RL_LIBSRC)COPYING $(READLINE_EXAMPLES) \
  470.            $(READLINE_DOC_SUPPORT)
  471.  
  472. #else /* !HAVE_READLINE_SOURCE */
  473.  
  474. #  if defined (READLINE)
  475. READLINE_LIBRARY = -lreadline
  476. #  endif /* READLINE */
  477. RL_LIBDIR = $(srcdir)/$(LIBSRC)readline/
  478.  
  479. #endif /* !HAVE_READLINE_SOURCE */
  480.  
  481. /* Right now we assume that you have the full source code to Bash,
  482.    including the source code to the history library.  If you only have
  483.    the library and header files installed, then you can undefine
  484.    HAVE_HISTORY_SOURCE. */
  485. #define HAVE_HISTORY_SOURCE
  486.  
  487. #if defined (READLINE) && !defined (HISTORY)
  488. #  define HISTORY
  489. #endif /* READLINE && !HISTORY */
  490.  
  491. #  if defined (HISTORY) && !defined (READLINE)
  492. /**/# You are compiling with history features but without line editing.
  493. HISTORY_LIB = -lhistory
  494. #  endif /* HISTORY && !READLINE */
  495.  
  496. #if defined (HISTORY)
  497. HIST_SUPPORT_SRC = bashhist.c
  498. HIST_SUPPORT_OBJ = bashhist.o
  499. #endif /* HISTORY */
  500.  
  501. #if defined (HAVE_HISTORY_SOURCE)
  502.  
  503. HIST_LIBSRC = $(LIBSRC)readline/
  504. HIST_LIBDOC = $(HIST_LIBSRC)doc/
  505. HIST_LIBDIR = $(LIBPATH)readline/
  506. HIST_ABSSRC = $${topdir}/$(HIST_LIBDIR)/
  507.  
  508. /* If you are building with readline, then you do not explicitly need the
  509.    history library. */
  510. #  if defined (READLINE)
  511. HISTORY_LIBRARY = 
  512. #  else
  513. HISTORY_LIBRARY = $(HIST_LIBDIR)libhistory.a
  514. #  endif /* !READLINE */
  515.  
  516. /**/# The source, object and documentation of the history library.
  517. HISTORY_SOURCE    = $(HIST_LIBSRC)history.c $(HIST_LIBSRC)history.h
  518. HISTORY_OBJ    = $(HIST_LIBDIR)history.o
  519. HISTORY_DOC    = $(HIST_LIBDOC)hist.texinfo $(HIST_LIBDOC)hsuser.texinfo \
  520.           $(HIST_LIBDOC)hstech.texinfo
  521.  
  522. /**/# Directory list for -L so that the link editor (ld) can find -lhistory.
  523. #  if defined (HISTORY) && !defined (READLINE)
  524. #    if !defined (LD_HAS_NO_DASH_L)
  525. HISTORY_LDFLAGS = $(SEARCH_LIB)$(HIST_LIBDIR)
  526. #    endif /* LD_HAS_NO_DASH_L */
  527. #  endif /* HISTORY && !READLINE */
  528. #else /* !HAVE_HISTORY_SOURCE */
  529. #  if defined (HISTORY) && !defined (READLINE)
  530. HISTORY_LIBRARY = -lhistory
  531. HISTORY_LDFLAGS = $(SEARCH_LIB)$(libdir) $(SEARCH_LIB)/usr/local/lib
  532. #  endif /* HISTORY && !READLINE */
  533. #endif /* !HAVE_HISTORY_SOURCE */
  534.  
  535. #if defined (USE_GNU_TERMCAP)
  536. #  define HAVE_TERMCAP_SOURCE
  537. TERM_LIBSRC = $(LIBSRC)termcap/
  538. TERM_LIBDIR = $(LIBPATH)termcap/
  539. TERM_ABSSRC = $${topdir}/$(TERM_LIBDIR)
  540.  
  541. /**/# The source, object and documentation for the GNU Termcap library.
  542. TERMCAP_LIBRARY = $(TERM_LIBDIR)libtermcap.a
  543.  
  544. TERMCAP_SOURCE    = $(TERM_LIBSRC)termcap.c $(TERM_LIBSRC)tparam.c
  545. TERMCAP_OBJ    = $(TERM_LIBDIR)termcap.o $(TERM_LIBDIR)tparam.o
  546. TERMCAP_DOC    = $(TERM_LIBSRC)termcap.texinfo
  547. TERMCAP_SUPPORT = $(TERM_LIBSRC)Makefile $(TERM_LIBSRC)ChangeLog
  548.  
  549. #  if !defined (LD_HAS_NO_DASH_L)
  550. TERMCAP_LDFLAGS = $(SEARCH_LIB)$(TERM_LIBDIR)
  551. #  endif /* !LD_HAS_NO_DASH_L */
  552. #else /* !USE_GNU_TERMCAP */
  553.  
  554. /* Guessed at symbol for LIBRARIES, below. */
  555. #  if defined (USE_TERMCAP_EMULATION)
  556. TERMCAP_LIBRARY = -lcurses
  557. #  else /* !USE_TERMCAP_EMULATION */
  558. TERMCAP_LIBRARY = -ltermcap
  559. #  endif /* !USE_TERMCAP_EMULATION */
  560. #endif /* !USE_GNU_TERMCAP */
  561.  
  562. /* The glob library is always used. */
  563. #define USE_GLOB_LIBRARY
  564.  
  565. #if defined (USE_GLOB_LIBRARY)
  566. GLOB_LIBSRC = $(LIBSRC)glob/
  567. GLOB_LIBDIR = $(LIBPATH)glob/
  568. GLOB_ABSSRC = $${topdir}/$(GLOB_LIBDIR)
  569.  
  570. GLOB_LIBRARY = $(GLOB_LIBDIR)libglob.a
  571.  
  572. GLOB_SOURCE = $(GLOB_LIBSRC)glob.c $(GLOB_LIBSRC)fnmatch.c \
  573.           $(GLOB_LIBSRC)fnmatch.h
  574. GLOB_OBJ    = $(GLOB_LIBDIR)glob.o $(GLOB_LIBDIR)fnmatch.o
  575. GLOB_DOC    = $(GLOB_LIBSRC)doc/glob.texi $(GLOB_LIBSRC)doc/Makefile
  576. GLOB_SUPPORT= $(GLOB_LIBSRC)Makefile $(GLOB_LIBSRC)ChangeLog
  577.  
  578. #  if !defined (LD_HAS_NO_DASH_L)
  579. GLOB_LDFLAGS = $(SEARCH_LIB)$(GLOB_LIBDIR)
  580. #  endif /* !LD_HAS_NO_DASH_L */
  581. GLOB_LIB     = -lglob
  582. #endif /* USE_GLOB_LIBRARY */
  583.  
  584. /* The source code for the tilde expansion library. */
  585. #if defined (HAVE_READLINE_SOURCE)
  586. #  define HAVE_TILDE_SOURCE
  587. #endif /* HAVE_READLINE_SOURCE */
  588.  
  589. #if defined (HAVE_TILDE_SOURCE)
  590. /**/# The source, object and documentation for the GNU Tilde library.
  591. TILDE_LIBSRC = $(LIBSRC)tilde/
  592. TILDE_LIBDIR = $(LIBPATH)tilde/
  593. TILDE_ABSSRC = $${topdir}/$(TILDE_LIBDIR)
  594.  
  595. TILDE_LIBRARY = $(TILDE_LIBDIR)libtilde.a
  596.  
  597. TILDE_SOURCE    = $(TILDE_LIBSRC)tilde.c $(TILDE_LIBSRC)tilde.h
  598. TILDE_OBJ    = $(TILDE_LIBDIR)tilde.o
  599. TILDE_DOC    = $(TILDE_LIBSRC)doc/tilde.texi $(TILDE_LIBSRC)doc/Makefile
  600. TILDE_SUPPORT    = $(TILDE_LIBSRC)Makefile $(TILDE_LIBSRC)ChangeLog
  601.  
  602. TILDE_LIB = -ltilde
  603.  
  604. #  if !defined (LD_HAS_NO_DASH_L)
  605. TILDE_LDFLAGS = $(SEARCH_LIB)$(TILDE_LIBDIR)
  606. #  endif /* !LD_HAS_NO_DASH_L */
  607.  
  608. #else /* !HAVE_TILDE_SOURCE */
  609. /**/# Guessed at location of the tilde 
  610. TILDE_LIBRARY = $(libdir)/libtilde.a
  611. #endif /* !HAVE_TILDE_SOURCE */
  612.  
  613. #if defined (USE_GNU_MALLOC_LIBRARY)
  614. /**/# Our malloc library.
  615. MALLOC_LIBSRC = $(LIBSRC)malloclib/
  616. MALLOC_LIBDIR = $(LIBPATH)malloclib/
  617. MALLOC_ABSSRC = $${topdir}/$(MALLOC_LIBDIR)
  618.  
  619. MALLOC_LIBRARY = $(MALLOC_LIBDIR)libmalloc.a
  620.  
  621. MALLOC_SOURCE = $(MALLOC_LIBSRC)calloc.c $(MALLOC_LIBSRC)cfree.c \
  622.         $(MALLOC_LIBSRC)free.c $(MALLOC_LIBSRC)malloc.c \
  623.         $(MALLOC_LIBSRC)mcheck.c $(MALLOC_LIBSRC)memalign.c \
  624.         $(MALLOC_LIBSRC)morecore.c $(MALLOC_LIBSRC)mstats.c \
  625.         $(MALLOC_LIBSRC)mtrace.c $(MALLOC_LIBSRC)realloc.c \
  626.         $(MALLOC_LIBSRC)valloc.c
  627. MALLOC_OBJ    = $(MALLOC_LIBDIR)calloc.c $(MALLOC_LIBDIR)cfree.c \
  628.         $(MALLOC_LIBDIR)free.c $(MALLOC_LIBDIR)malloc.c \
  629.         $(MALLOC_LIBDIR)mcheck.c $(MALLOC_LIBDIR)memalign.c \
  630.         $(MALLOC_LIBDIR)morecore.c $(MALLOC_LIBDIR)mstats.c \
  631.         $(MALLOC_LIBDIR)mtrace.c $(MALLOC_LIBDIR)realloc.c \
  632.         $(MALLOC_LIBDIR)valloc.c
  633.  
  634. MALLOC_SUPPORT= $(MALLOC_LIBSRC)Makefile
  635. MALLOC_CFLAGS = -DUSE_GNU_MALLOC_LIBRARY
  636.  
  637. #  if !defined (LD_HAS_NO_DASH_L)
  638. MALLOC_LDFLAGS = $(SEARCH_LIB)$(MALLOC_LIBDIR)
  639. #  endif /* !LD_HAS_NO_DASH_L */
  640. MALLOC_LIB     = -lmalloc
  641.  
  642. MALLOC_DEP = $(MALLOC_LIBRARY)
  643. #else
  644. MALLOC_LIBRARY =
  645. #endif /* USE_GNU_MALLOC_LIBRARY */
  646.  
  647. BASHPOSIX_LIB     = $(LIBSRC)posixheaders/
  648. BASHPOSIX_SUPPORT = $(BASHPOSIX_LIB)posixstat.h $(BASHPOSIX_LIB)ansi_stdlib.h \
  649.             $(BASHPOSIX_LIB)memalloc.h $(BASHPOSIX_LIB)stdc.h
  650.  
  651. /**/# Declare all of the sources for the libraries that we have.
  652. LIBRARY_SOURCE  = $(READLINE_SOURCE) $(HISTORY_SOURCE) $(TERMCAP_SOURCE) \
  653.           $(GLOB_SOURCE) $(TILDE_SOURCE) $(MALLOC_SOURCE)
  654. LIBRARY_DOC    = $(READLINE_DOC) $(HISTORY_DOC) $(TERMCAP_DOC) $(GLOB_DOC) \
  655.           $(TILDE_DOC) $(MALLOC_DOC)
  656. LIBRARY_SUPPORT = $(READLINE_SUPPORT) $(HISTORY_SUPPORT) $(TERMCAP_SUPPORT) \
  657.           $(GLOB_SUPPORT) $(TILDE_SUPPORT) $(MALLOC_SUPPORT)
  658. LIBRARY_TAR     = $(LIBRARY_SOURCE) $(LIBRARY_DOC) $(LIBRARY_SUPPORT)
  659.  
  660. #if defined (READLINE)
  661. /**/# You wish to compile with the line editing features installed.
  662. READLINE_LIB = -lreadline
  663.  
  664. /**/# You only need termcap (or curses) if you are linking with GNU Readline.
  665. #  if defined (USE_TERMCAP_EMULATION)
  666. TERMCAP_LIB = -lcurses
  667. #  else  /* !USE_TERMCAP_EMULATION */
  668. TERMCAP_LIB = -ltermcap
  669. #  endif /* !USE_TERMCAP_EMULATION */
  670.  
  671. /**/# Directory list for -L so that the link editor (ld) can find -lreadline.
  672. #  if !defined (LD_HAS_NO_DASH_L)
  673. #    if defined (HAVE_READLINE_SOURCE)
  674. READLINE_LDFLAGS = $(SEARCH_LIB)$(RL_LIBDIR) $(TERMCAP_LDFLAGS)
  675. #    else
  676. READLINE_LDFLAGS = $(TERMCAP_LDFLAGS) $(SEARCH_LIB)$(libdir) \
  677.            $(SEARCH_LIB)/usr/local/lib
  678. #    endif /* HAVE_READLINE_SOURCE */
  679. #  endif /* LD_HAS_NO_DASH_L */
  680.  
  681. /**/# The source and object of the bash<->readline interface code.
  682. RL_SUPPORT_SRC = bashline.c bracecomp.c
  683. RL_SUPPORT_OBJ = bashline.o $(BRACECOMP_OBJECT)
  684. #endif /* READLINE */
  685.  
  686. /**/# The order is important.  Most dependent first.
  687. #if defined (LD_HAS_NO_DASH_L)
  688. /**/# This linker does not know how to grok the -l flag, or perhaps how
  689. /**/# to grok the -L flag, or both.
  690. LIBRARIES = $(READLINE_LIBRARY) $(HISTORY_LIBRARY) $(TERMCAP_LIBRARY) \
  691.         $(GLOB_LIBRARY) $(TILDE_LIBRARY) $(MALLOC_LIBRARY) $(LOCAL_LIBS)
  692. #else /* !LD_HAS_NO_DASH_L */
  693. LIBRARIES = $(READLINE_LIB) $(HISTORY_LIB) $(TERMCAP_LIB) $(GLOB_LIB) \
  694.         $(TILDE_LIB) $(MALLOC_LIB) $(LOCAL_LIBS)
  695. #endif /* !LD_HAS_NO_DASH_L */
  696.  
  697. #if defined (READLINE)
  698. #  if defined (HAVE_TERMCAP_SOURCE)
  699. TERMCAP_DEP = $(TERMCAP_LIBRARY)
  700. #  endif /* HAVE_TERMCAP_SOURCE */
  701. #  if defined (HAVE_READLINE_SOURCE)
  702. READLINE_DEP = $(READLINE_LIBRARY)
  703. #  endif /* HAVE_READLINE_SOURCE */
  704. #endif /* READLINE */
  705.  
  706. #if defined (HISTORY) && defined (HAVE_HISTORY_SOURCE) && !defined (READLINE)
  707. HISTORY_DEP = $(HISTORY_LIBRARY)
  708. #endif
  709.  
  710. #if defined (USE_GLOB_LIBRARY)
  711. GLOB_DEP = $(GLOB_LIBRARY)
  712. #else
  713. GLOBC = glob.c fnmatch.c
  714. GLOBO = glob.o fnmatch.o
  715. #endif /* USE_GLOB_LIBRARY */
  716.  
  717. #if defined (HAVE_TILDE_SOURCE)
  718. TILDE_DEP = $(TILDE_LIBRARY)
  719. #endif
  720.  
  721. /**/# Source files for libraries that Bash depends on.
  722. LIBDEP = $(READLINE_DEP) $(TERMCAP_DEP) $(GLOB_DEP) $(HISTORY_DEP) $(TILDE_DEP) $(MALLOC_DEP)
  723.  
  724. /**/# Rules for cleaning the readline and termcap sources.
  725. #if defined (HAVE_READLINE_SOURCE)
  726. CLEAN_READLINE = (cd $(RL_LIBDIR); $(MAKE) $(MFLAGS) clean)
  727. #else
  728. CLEAN_READLINE = :
  729. #endif /* !HAVE_READLINE_SOURCE */
  730.  
  731. #if defined (HAVE_HISTORY_SOURCE)
  732. #  if !defined (READLINE)
  733. CLEAN_HISTORY = (cd $(HIST_LIBDIR); $(MAKE) $(MFLAGS) clean)
  734. #  else
  735. CLEAN_HISTORY = :
  736. #  endif /* READLINE */
  737. #endif /* !HAVE_HISTORY_SOURCE */
  738.  
  739. #if defined (HAVE_TERMCAP_SOURCE)
  740. CLEAN_TERMCAP = (cd $(TERM_LIBDIR); $(MAKE) $(MFLAGS) clean)
  741. #else
  742. CLEAN_TERMCAP = :
  743. #endif /* !HAVE_TERMCAP_SOURCE */
  744.  
  745. #if defined (USE_GLOB_LIBRARY)
  746. CLEAN_GLOB = (cd $(GLOB_LIBDIR); $(MAKE) $(MFLAGS) clean)
  747. #else
  748. CLEAN_GLOB = :
  749. #endif /* !USE_GLOB_LIBRARY */
  750.  
  751. #if defined (HAVE_TILDE_SOURCE)
  752. CLEAN_TILDE = (cd $(TILDE_LIBDIR); $(MAKE) $(MFLAGS) clean)
  753. #else
  754. CLEAN_TILDE = :
  755. #endif /* !HAVE_TILDE_SOURCE */
  756.  
  757. #if defined (USE_GNU_MALLOC_LIBRARY)
  758. CLEAN_MALLOC = (cd $(MALLOC_LIBDIR); $(MAKE) $(MFLAGS) clean)
  759. #else
  760. CLEAN_MALLOC = :
  761. #endif /* !USE_GNU_MALLOC_LIBRARY */
  762.  
  763. LIBRARY_LDFLAGS = $(READLINE_LDFLAGS) $(HISTORY_LDFLAGS) $(TILDE_LDFLAGS) \
  764.           $(GLOB_LDFLAGS) $(MALLOC_LDFLAGS)
  765.  
  766. /**/# The directory which contains the source for malloc.  The name must
  767. /**/# end in a slash, as in "./lib/malloc/".
  768. ALLOC_LIBSRC = $(LIBSRC)malloc/
  769. ALLOC_LIBDIR = $(LIBPATH)malloc/
  770. ALLOC_ABSSRC = $${topdir}/$(ALLOC_LIBDIR)
  771.  
  772. /**/# Our malloc.
  773. #if defined (USE_GNU_MALLOC) && !defined (USE_GNU_MALLOC_LIBRARY)
  774.  
  775. MALLOC_OBJ = $(ALLOC_LIBDIR)malloc.o
  776. MALLOC_SRC = $(ALLOC_LIBSRC)malloc.c
  777. MALLOC_DEP = $(MALLOC_SRC) $(ALLOC_LIBSRC)getpagesize.h
  778. MALLOC_FLAGS = -Drcheck -Dbotch=programming_error
  779.  
  780. MALLOC_LIBRARY =
  781.  
  782. #endif /* USE_GNU_MALLOC && !USE_GNU_MALLOC_LIBRARY */
  783.  
  784. /* If this user doesn't have alloca (), then we must try to supply them
  785.    with a working one. */
  786. #if !defined (HAVE_ALLOCA)
  787. ALLOCA = $(ALLOC_LIBDIR)alloca.o
  788. #  if defined (ALLOCA_ASM)
  789. ALLOCA_SOURCE = ALLOCA_ASM
  790. ALLOCA_OBJECT = ALLOCA_OBJ
  791. #  else
  792. ALLOCA_SOURCE = alloca.c
  793. ALLOCA_OBJECT = alloca.o
  794. #  endif /* ALLOCA_ASM */
  795. ALLOCA_DEP = $(ALLOC_LIBSRC)$(ALLOCA_SOURCE)
  796. #endif /* !HAVE_ALLOCA */
  797.  
  798. /* Compilation flags to use in the shell directory and to pass to builds
  799.    in subdirectories (readline, termcap) to ensure that alloca is treated
  800.    in a consistent fashion. */
  801. #if defined (HAVE_ALLOCA_H)
  802. ALLOCA_H_DEFINE = -DHAVE_ALLOCA_H
  803. #else
  804. ALLOCA_H_DEFINE =
  805. #endif /* HAVE_ALLOCA_H */
  806.  
  807. #if defined (HAVE_ALLOCA)
  808. ALLOCA_DEFINE = -DHAVE_ALLOCA
  809. #else
  810. ALLOCA_DEFINE =
  811. #endif /* HAVE_ALLOCA */
  812.  
  813. ALLOCA_CFLAGS = $(ALLOCA_DEFINE) $(ALLOCA_H_DEFINE)
  814.  
  815. /* Protect the `i386' used in the definition of ALLOC_FILES. */
  816. #if defined (i386)
  817. #  undef i386
  818. #  define i386_defined
  819. #endif /* i386 */
  820.  
  821. ALLOC_HEADERS = $(ALLOC_LIBSRC)getpagesize.h
  822. ALLOC_FILES = $(ALLOC_LIBSRC)malloc.c $(ALLOC_LIBSRC)alloca.c \
  823.           $(ALLOC_LIBSRC)i386-alloca.s $(ALLOC_LIBSRC)x386-alloca.s \
  824.           $(ALLOC_LIBSRC)xmalloc.c
  825.  
  826. /* Perhaps restore the `i386' define. */
  827. #if defined (i386_defined)
  828. #  define i386
  829. #  undef i386_defined
  830. #endif /* i386_defined */
  831.  
  832. #if defined (USE_GNU_MALLOC) && !defined (USE_GNU_MALLOC_LIBRARY)
  833. $(MALLOC_OBJ):    $(MALLOC_DEP)
  834.         @sh $(SUPPORT_SRC)mkdirs $(ALLOC_LIBDIR)
  835.         @$(RM) $@
  836.         @($(LIBINC_DECL); cd $(ALLOC_LIBDIR) ; \
  837.          if [ ! -f Makefile ]; then cp $(ALLOC_ABSSRC)Makefile Makefile ; fi; \
  838.          $(MAKE) $(MFLAGS) \
  839.          CFLAGS='$(LIBRARY_CFLAGS) $(MALLOC_FLAGS)' \
  840.          CPPFLAGS='$(CPPFLAGS)' MALLOC_SOURCE=$(MALLOC_SRC) \
  841.          srcdir=$(ALLOC_ABSSRC) malloc.o )
  842. #endif /* USE_GNU_MALLOC && !USE_GNU_MALLOC_LIBRARY */
  843.  
  844. #if !defined (HAVE_ALLOCA)
  845. $(ALLOCA):    $(ALLOCA_DEP)
  846.         @sh $(SUPPORT_SRC)mkdirs $(ALLOC_LIBDIR)
  847.         @$(RM) $@
  848.         @($(LIBINC_DECL); cd $(ALLOC_LIBDIR) ; \
  849.          if [ ! -f Makefile ]; then cp $(ALLOC_ABSSRC)Makefile Makefile ; fi; \
  850.                  $(MAKE) $(MFLAGS) CC='$(CC)' \
  851.          CFLAGS='$(LIBRARY_CFLAGS) $(MALLOC_FLAGS)' \
  852.                  CPPFLAGS='$(CPPFLAGS)' ALLOCA_SOURCE=$(ALLOCA_SOURCE) \
  853.          ALLOCA_OBJECT=$(ALLOCA_OBJECT) \
  854.          srcdir=$(ALLOC_ABSSRC) alloca.o )
  855. #endif /* !HAVE_ALLOCA */
  856.  
  857. /**/# The location of ranlib on your system.
  858. #if defined (RANLIB_LOCATION)
  859. RANLIB = RANLIB_LOCATION
  860. #else
  861. RANLIB = ranlib
  862. #endif /* RANLIB_LOCATION */
  863.  
  864. /* **************************************************************** */
  865. /*                                                                  */
  866. /*               Support for optional object files            */
  867. /*                                                                  */
  868. /* **************************************************************** */
  869. #if !defined (HAVE_SYS_SIGLIST)
  870. /**/# Since this system does not have sys_siglist, we define SIGLIST
  871. /**/# as siglist.o.
  872. SIGLIST = siglist.o
  873. SIGLIST_FLAG=-DINITIALIZE_SIGLIST
  874. #endif /* HAVE_SYS_SIGLIST */
  875.  
  876. #if !defined (HAVE_GETCWD)
  877. /**/# Since this system does not have a correctly working getcwd (),
  878. /**/# we define GETCWD as getcwd.o.
  879. GETCWD = getcwd.o
  880. #endif /* !HAVE_GETCWD */
  881.  
  882. /**/# The source and object of the curly brace expansion and completion code.
  883. BRACES_SOURCE     = braces.c
  884. BRACECOMP_SOURCE = bracecomp.c
  885. #if defined (BRACE_EXPANSION)
  886. BRACES_OBJECT = braces.o
  887. #  if defined (READLINE)
  888. BRACECOMP_OBJECT = bracecomp.o
  889. #  endif /* READLINE */
  890. #endif /* BRACE_EXPANSION */
  891.  
  892. #if defined (REQUIRED_LIBRARIES)
  893. /**/# Locally required libraries.
  894. LOCAL_LIBS = REQUIRED_LIBRARIES
  895. #endif /* REQUIRED_LIBRARIES */
  896.  
  897. BUILTINS_LIB = builtins/libbuiltins.a
  898.  
  899. /**/# The main source code for the Bourne Again SHell.
  900. CSOURCES = shell.c parse.y general.c make_cmd.c print_cmd.c y.tab.c \
  901.        dispose_cmd.c execute_cmd.c variables.c $(GLOBC) version.c \
  902.        expr.c copy_cmd.c flags.c subst.c hash.c mailcheck.c \
  903.        test.c trap.c jobs.c nojobs.c $(ALLOC_FILES) $(BRACES_SOURCE) \
  904.        vprint.c input.c bashhist.c \
  905.        unwind_prot.c siglist.c getcwd.c $(RL_SUPPORT_SRC) error.c
  906.  
  907. HSOURCES = shell.h flags.h trap.h hash.h jobs.h builtins.h alias.c y.tab.h \
  908.        general.h variables.h config.h $(ALLOC_HEADERS) alias.h maxpath.h \
  909.        quit.h machines.h posixstat.h filecntl.h unwind_prot.h parser.h \
  910.        command.h input.h error.h bashansi.h dispose_cmd.h make_cmd.h \
  911.        subst.h externs.h siglist.h bashhist.h bashtypes.h
  912.  
  913. SOURCES     = $(CSOURCES) $(HSOURCES) $(BUILTIN_DEFS)
  914.  
  915. /**/# Matching object files.
  916. OBJECTS     = shell.o y.tab.o general.o make_cmd.o print_cmd.o $(GLOBO) \
  917.        dispose_cmd.o execute_cmd.o variables.o copy_cmd.o error.o \
  918.        expr.o flags.o jobs.o subst.o hash.o mailcheck.o test.o \
  919.        trap.o alias.o $(MALLOC_OBJ) $(ALLOCA) $(BRACES_OBJECT) \
  920.        unwind_prot.o $(VPRINT_OBJ) input.o $(HIST_SUPPORT_OBJ) \
  921.        $(SIGLIST) $(GETCWD) version.o $(RL_SUPPORT_OBJ) $(BUILTINS_LIB)
  922.  
  923. #if defined (LOAD_BUILTIN)
  924. LOAD_DEF = $(DEFDIR)load.def
  925. LOAD_OBJ = $(DEFDIR)load.o
  926. #endif /* LOAD_BUILTIN */
  927.  
  928. /**/# Where the source code of the shell builtins resides.
  929. BUILTIN_SRCDIR=$(srcdir)/builtins/
  930. /**/# The trailing slash was left off this definition on purpose
  931. BUILTIN_ABSSRC=$${topdir}/builtins
  932. DEFDIR = builtins/
  933. BUILTIN_DEFS = $(DEFDIR)alias.def $(DEFDIR)bind.def $(DEFDIR)break.def \
  934.            $(DEFDIR)builtin.def $(DEFDIR)cd.def $(DEFDIR)colon.def \
  935.            $(DEFDIR)command.def $(DEFDIR)declare.def $(LOAD_DEF) \
  936.            $(DEFDIR)echo.def $(DEFDIR)enable.def $(DEFDIR)eval.def \
  937.            $(DEFDIR)exec.def $(DEFDIR)exit.def $(DEFDIR)fc.def \
  938.            $(DEFDIR)fg_bg.def $(DEFDIR)hash.def $(DEFDIR)help.def \
  939.            $(DEFDIR)history.def $(DEFDIR)jobs.def $(DEFDIR)kill.def \
  940.            $(DEFDIR)let.def $(DEFDIR)read.def $(DEFDIR)return.def \
  941.            $(DEFDIR)set.def $(DEFDIR)setattr.def $(DEFDIR)shift.def \
  942.            $(DEFDIR)source.def $(DEFDIR)suspend.def $(DEFDIR)test.def \
  943.            $(DEFDIR)times.def $(DEFDIR)trap.def $(DEFDIR)type.def \
  944.            $(DEFDIR)ulimit.def $(DEFDIR)umask.def $(DEFDIR)wait.def \
  945.            $(DEFDIR)getopts.def $(DEFDIR)reserved.def
  946. BUILTIN_C_SRC  = $(DEFDIR)mkbuiltins.c $(DEFDIR)common.c \
  947.           $(DEFDIR)hashcom.h $(DEFDIR)/bashgetopt.c $(GETOPT_SOURCE)
  948. BUILTIN_C_OBJ  = $(GETOPTS_OBJ) $(DEFDIR)common.o $(DEFDIR)bashgetopt.o
  949. BUILTIN_OBJS = $(DEFDIR)alias.o $(DEFDIR)bind.o $(DEFDIR)break.o \
  950.            $(DEFDIR)builtin.o $(DEFDIR)cd.o $(DEFDIR)colon.o \
  951.            $(DEFDIR)command.o $(DEFDIR)declare.o $(LOAD_OBJ) \
  952.            $(DEFDIR)echo.o $(DEFDIR)enable.o $(DEFDIR)eval.o \
  953.            $(DEFDIR)exec.o $(DEFDIR)exit.o $(DEFDIR)fc.o \
  954.            $(DEFDIR)fg_bg.o $(DEFDIR)hash.o $(DEFDIR)help.o \
  955.            $(DEFDIR)history.o $(DEFDIR)jobs.o $(DEFDIR)kill.o \
  956.            $(DEFDIR)let.o $(DEFDIR)read.o $(DEFDIR)return.o \
  957.            $(DEFDIR)set.o $(DEFDIR)setattr.o $(DEFDIR)shift.o \
  958.            $(DEFDIR)source.o $(DEFDIR)suspend.o $(DEFDIR)test.o \
  959.            $(DEFDIR)times.o $(DEFDIR)trap.o $(DEFDIR)type.o \
  960.            $(DEFDIR)ulimit.o $(DEFDIR)umask.o $(DEFDIR)wait.o \
  961.            $(BUILTIN_C_OBJ)
  962. #if defined (GETOPTS_BUILTIN)
  963. GETOPTS_OBJ    = $(DEFDIR)getopts.o
  964. #endif
  965. GETOPT_SOURCE   = $(DEFDIR)getopt.c $(DEFDIR)getopt.h
  966. PSIZE_SOURCE    = $(DEFDIR)psize.sh $(DEFDIR)psize.c
  967. BUILTIN_SUPPORT = $(DEFDIR)Makefile $(DEFDIR)ChangeLog $(PSIZE_SOURCE) \
  968.           $(BUILTIN_C_SRC)
  969.  
  970. /**/# Documentation for the shell.
  971. DOCDIR = $(srcdir)/documentation/
  972. BASH_TEXINFO = $(DOCDIR)*.texi $(DOCDIR)*.tex \
  973.             $(DOCDIR)*.dvi $(DOCDIR)Makefile
  974. BASH_MAN = $(DOCDIR)bash.1
  975. BASHDOCS = $(BASH_TEXINFO) $(BASH_MAN) INSTALL README RELEASE
  976. DOCUMENTATION = $(BASHDOCS) $(LIBRARY_DOC)
  977.  
  978. /**/# Some example files demonstrating use of the shell.
  979. /* This has to be written funny to avoid looking like a comment starter. */
  980. EXAMPLES = examples/[a-zA-Z]*
  981.  
  982. ENDIAN_SUPPORT = endian.c
  983. #if !defined (HAVE_WAIT_H)
  984. ENDIAN_HEADER = bash_endian.h
  985. #else
  986. ENDIAN_HEADER =
  987. #endif
  988. ENDIAN_OUTPUT = endian.aux $(ENDIAN_HEADER)
  989.  
  990. SIGNAMES_SUPPORT = signames.c
  991. SIGNAMES_OUTPUT  = signames.aux signames.h
  992.  
  993. SUPPORT_SRC = $(srcdir)/support/
  994. SDIR = ./support/
  995. MKTARFILE = $(SDIR)mktarfile
  996. SCRIPTS_SUPPORT = $(SUPPORT_SRC)mksysdefs $(SUPPORT_SRC)cppmagic \
  997.           $(SUPPORT_SRC)cat-s $(MKTARFILE) $(SUPPORT_SRC)mail-shell \
  998.           $(SUPPORT_SRC)inform $(SUPPORT_SRC)/fixdist \
  999.           $(SUPPORT_SRC)mklinks $(SUPPORT_SRC)PORTING \
  1000.           $(SUPPORT_SRC)/clone.bash
  1001. FAQ = $(SUPPORT_SRC)FAQ
  1002.  
  1003. TEST_SUITE = ./test-suite/
  1004. TEST_SUITE_SUPPORT = $(TEST_SUITE)[a-zA-Z0-9]* $(SUPPORT_SRC)recho.c
  1005.  
  1006. CREATED_SUPPORT = $(ENDIAN_OUTPUT) $(SIGNAMES_OUTPUT) sysdefs.h \
  1007.           $(SDIR)getcppsyms recho tests/recho
  1008.  
  1009. SUPPORT = configure $(ENDIAN_SUPPORT) $(SIGNAMES_SUPPORT) $(SCRIPTS_SUPPORT) \
  1010.       $(BUILTIN_SUPPORT) COPYING Makefile cpp-Makefile ChangeLog \
  1011.       .distribution newversion.c $(EXAMPLES) $(SUPPORT_SRC)bash.xbm \
  1012.       $(FAQ) $(SUPPORT_SRC)getcppsyms.c $(TEST_SUITE_SUPPORT)
  1013.  
  1014. /**/# BAGGAGE consists of things that you want to keep with the shell for some
  1015. /**/# reason, but do not actually use; old source code, etc.
  1016. BAGGAGE =
  1017.  
  1018. /**/# Things that the world at large needs.
  1019. THINGS_TO_TAR = $(SOURCES) $(LIBRARY_TAR) $(BASHDOCS) $(SUPPORT) $(BAGGAGE)
  1020.  
  1021. /**/# Keep GNU Make from exporting the entire environment for small machines.
  1022. .NOEXPORT:
  1023.  
  1024. .made: $(Program) bashbug
  1025.     cp .machine .made
  1026.  
  1027. $(Program):  .build $(OBJECTS) $(LIBDEP) .distribution
  1028.     $(RM) $@
  1029.     $(PURIFY) $(CC) $(LDFLAGS) $(LIBRARY_LDFLAGS) -o $(Program) $(OBJECTS) $(LIBRARIES)
  1030.     ls -l $(Program)
  1031.     size $(Program)
  1032.  
  1033. .build:    $(SOURCES) cpp-Makefile newversion.aux
  1034.     if ./newversion.aux -dir $(srcdir) -build; then mv -f newversion.h version.h; fi
  1035.     @echo
  1036.     @echo "      ***************************************************"
  1037.     @echo "      *                            *"
  1038.     @echo "      * Making Bash-`cat $(srcdir)/.distribution`.`cat $(srcdir)/.patchlevel` for a $(Machine) running $(OS)"
  1039.     @echo "      *                            *"
  1040.     @echo "      ***************************************************"
  1041.     @echo
  1042.     @echo "$(Program) last made for a $(Machine) running $(OS)" >.machine
  1043.  
  1044. bashbug: $(SUPPORT_SRC)bashbug.sh cpp-Makefile newversion.aux
  1045.     @sed -e "s:@MACHINE@:$(Machine):" -e "s:@OS@:$(OS):" \
  1046.          -e "s:@CFLAGS@:$(CCFLAGS):" -e "s:@CC@:$(CC):" \
  1047.          -e "s:@RELEASE@:`cat $(srcdir)/.distribution`:" \
  1048.          -e "s:@PATCHLEVEL@:`cat $(srcdir)/.patchlevel`:" \
  1049.          $(SUPPORT_SRC)bashbug.sh > $@
  1050.     @chmod a+rx bashbug
  1051.  
  1052. version.h:    newversion.aux
  1053.     if ./newversion.aux -dir $(srcdir) -build; then mv -f newversion.h version.h; fi
  1054.  
  1055. y.tab.c: parser-built
  1056. y.tab.h: parser-built
  1057. parser-built:    parse.y parser.h command.h stdc.h input.h
  1058.     $(RM) $@
  1059.     -if test -f y.tab.h; then mv -f y.tab.h old-y.tab.h; fi
  1060.     @echo expect 66 shift/reduce conflicts
  1061.     $(BISON) -d $(srcdir)/parse.y
  1062.     -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; fi
  1063.     touch $@
  1064.  
  1065. #if defined (READLINE) && defined (HAVE_READLINE_SOURCE)
  1066. $(READLINE_LIBRARY): $(READLINE_SOURCE)
  1067.     build_lib_in_dir ($(RL_LIBDIR), libreadline.a, srcdir=$(RL_ABSSRC), $(RL_ABSSRC)Makefile)
  1068. #endif /* READLINE && HAVE_READLINE_SOURCE */
  1069.  
  1070. #if defined (HISTORY) && defined (HAVE_HISTORY_SOURCE) && !defined (READLINE)
  1071. $(HISTORY_LIBRARY): $(HISTORY_SOURCE)
  1072.     build_lib_in_dir ($(HIST_LIBDIR), libhistory.a, srcdir=$(HIST_ABSSRC), $(HIST_ABSSRC)Makefile)
  1073. #endif /* HISTORY && HAVE_HISTORY_SOURCE && !READLINE */
  1074.  
  1075. #if defined (HAVE_TERMCAP_SOURCE)
  1076. $(TERMCAP_LIBRARY): $(TERMCAP_SOURCE)
  1077.     build_lib_in_dir ($(TERM_LIBDIR), libtermcap.a, srcdir=$(TERM_ABSSRC), $(TERM_ABSSRC)Makefile)
  1078. #endif /* HAVE_TERMCAP_SOURCE */
  1079.  
  1080. #if defined (USE_GLOB_LIBRARY)
  1081. $(GLOB_LIBRARY): $(GLOB_SOURCE)
  1082.     build_lib_in_dir ($(GLOB_LIBDIR), libglob.a, srcdir=$(GLOB_ABSSRC), $(GLOB_ABSSRC)Makefile)
  1083. #endif /* USE_GLOB_LIBRARY */
  1084.  
  1085. #if defined (HAVE_TILDE_SOURCE)
  1086. $(TILDE_LIBRARY): $(TILDE_SOURCE)
  1087.     build_lib_in_dir ($(TILDE_LIBDIR), libtilde.a, srcdir=$(TILDE_ABSSRC), $(TILDE_ABSSRC)Makefile)
  1088. #endif /* HAVE_TILDE_SOURCE */
  1089.  
  1090. #if defined (USE_GNU_MALLOC) && defined (USE_GNU_MALLOC_LIBRARY)
  1091. $(MALLOC_LIBRARY): $(MALLOC_SOURCE)
  1092.     build_lib_in_dir ($(MALLOC_LIBDIR), libmalloc.a, srcdir=$(MALLOC_ABSSRC), $(MALLOC_ABSSRC)Makefile)
  1093. #endif /* USE_GNU_MALLOC && USE_GNU_MALLOC_LIBRARY */
  1094.  
  1095. version.o: version.c version.h
  1096.  
  1097. shell.o: shell.c shell.h flags.h shell.c posixstat.h filecntl.h stdc.h \
  1098.           $(ENDIAN_HEADER) parser.h
  1099.     $(RM) $@
  1100.     $(CC) $(CFG_FLAGS) $(CCFLAGS) $(CPPFLAGS) -c $<
  1101.  
  1102. #if !defined (HAVE_WAIT_H)
  1103. $(ENDIAN_HEADER):     endian.aux
  1104.     $(RM) $@
  1105.     ./endian.aux $@
  1106. #endif
  1107.  
  1108. signames.h:   signames.aux
  1109.     $(RM) $@
  1110.     ./signames.aux $@
  1111.  
  1112. variables.o:  variables.c shell.h hash.h flags.h variables.h
  1113.         $(RM) $@
  1114.         $(CC) -c $(CCFLAGS) $(HOSTTYPE_DECL) $(CPPFLAGS) $<
  1115.  
  1116. builtins/libbuiltins.a: $(BUILTIN_OBJS) config.h memalloc.h
  1117.     build_builtins (libbuiltins.a)
  1118.  
  1119. #if 0
  1120. /* This is a nice idea, but it does not work right, and the syntax is
  1121.    not universally available. */
  1122. $(BUILTIN_OBJS):    $(BUILTIN_DEFS)
  1123.     build_builtins ($(@F))
  1124. #endif
  1125.  
  1126. builtins/common.o:    $(BUILTIN_SRCDIR)common.c
  1127.     build_builtins (common.o)
  1128. builtins/bashgetopt.o:    $(BUILTIN_SRCDIR)bashgetopt.c
  1129.     build_builtins (bashgetopt.o)
  1130.  
  1131. builtins/builtext.h: builtins/libbuiltins.a
  1132.  
  1133. /* Dependencies for the main bash source. */
  1134. copy_cmd.o: shell.h command.h stdc.h hash.h
  1135. copy_cmd.o: general.h variables.h config.h memalloc.h quit.h
  1136. copy_cmd.o: dispose_cmd.h make_cmd.h subst.h externs.h
  1137. dispose_cmd.o: shell.h command.h stdc.h
  1138. dispose_cmd.o: general.h variables.h config.h memalloc.h quit.h
  1139. dispose_cmd.o: dispose_cmd.h make_cmd.h subst.h externs.h
  1140. error.o: error.h
  1141. execute_cmd.o: shell.h command.h stdc.h y.tab.h posixstat.h flags.h jobs.h
  1142. execute_cmd.o: general.h variables.h config.h memalloc.h quit.h hash.h
  1143. execute_cmd.o: unwind_prot.h siglist.h builtins/builtext.h 
  1144. execute_cmd.o: dispose_cmd.h make_cmd.h subst.h externs.h bashtypes.h
  1145. expr.o: shell.h command.h stdc.h hash.h
  1146. expr.o: general.h variables.h config.h memalloc.h quit.h
  1147. expr.o: dispose_cmd.h make_cmd.h subst.h externs.h
  1148. flags.o: flags.h stdc.h config.h memalloc.h general.h quit.h
  1149. general.o: shell.h command.h stdc.h maxpath.h
  1150. general.o: general.h variables.h config.h memalloc.h quit.h machines.h
  1151. general.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1152. hash.o: shell.h command.h stdc.h hash.h
  1153. hash.o: general.h variables.h config.h memalloc.h quit.h
  1154. hash.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1155. jobs.o: shell.h command.h stdc.h hash.h trap.h jobs.h siglist.h
  1156. jobs.o: general.h variables.h config.h memalloc.h quit.h
  1157. jobs.o: dispose_cmd.h make_cmd.h subst.h externs.h builtins/builtext.h
  1158. mailcheck.o: posixstat.h maxpath.h variables.h
  1159. mailcheck.o: hash.h quit.h
  1160. make_cmd.o: shell.h command.h stdc.h flags.h input.h bashtypes.h
  1161. make_cmd.o: general.h variables.h config.h memalloc.h quit.h
  1162. make_cmd.o: dispose_cmd.h make_cmd.h subst.h externs.h
  1163. y.tab.o: shell.h command.h stdc.h flags.h maxpath.h alias.h
  1164. y.tab.o: general.h variables.h config.h memalloc.h quit.h
  1165. y.tab.o: dispose_cmd.h make_cmd.h subst.h externs.h bashtypes.h
  1166. print_cmd.o: shell.h command.h stdc.h y.tab.h
  1167. print_cmd.o: general.h variables.h config.h memalloc.h quit.h
  1168. print_cmd.o: dispose_cmd.h make_cmd.h subst.h externs.h
  1169. shell.o: shell.h command.h stdc.h flags.h machines.h
  1170. shell.o: general.h variables.h config.h memalloc.h quit.h
  1171. shell.o: dispose_cmd.h make_cmd.h subst.h externs.h
  1172. shell.o: posixstat.h filecntl.h jobs.h input.h
  1173. subst.o: shell.h command.h stdc.h flags.h jobs.h siglist.h bashtypes.h
  1174. subst.o: general.h variables.h config.h memalloc.h quit.h
  1175. subst.o: dispose_cmd.h make_cmd.h subst.h externs.h execute_cmd.h
  1176. test.o: posixstat.h
  1177. trap.o: trap.h shell.h command.h stdc.h hash.h unwind_prot.h signames.h
  1178. trap.o: general.h variables.h config.h memalloc.h quit.h
  1179. trap.o: dispose_cmd.h make_cmd.h subst.h externs.h
  1180. unwind_prot.o: config.h memalloc.h general.h unwind_prot.h
  1181. variables.o: shell.h command.h stdc.h hash.h flags.h
  1182. variables.o: config.h memalloc.h general.h variables.h quit.h
  1183. variables.o: execute_cmd.h dispose_cmd.h make_cmd.h subst.h externs.h
  1184. version.o: version.h .build
  1185.  
  1186. alias.o: ansi_stdlib.h
  1187. bashline.o: ansi_stdlib.h
  1188. variables.o: ansi_stdlib.h
  1189. shell.o: ansi_stdlib.h
  1190. error.o: ansi_stdlib.h
  1191. hash.o: ansi_stdlib.h
  1192. signames.o: ansi_stdlib.h
  1193. expr.o: ansi_stdlib.h
  1194. general.o: ansi_stdlib.h
  1195. input.o: ansi_stdlib.h
  1196.  
  1197. #if !defined (JOB_CONTROL)
  1198. jobs.o: nojobs.c
  1199. #endif /* !JOB_CONTROL */
  1200.  
  1201. #if defined (BRACE_EXPANSION)
  1202. braces.o: general.h shell.h variables.h quit.h config.h memalloc.h
  1203. braces.o: dispose_cmd.h make_cmd.h subst.h externs.h
  1204. braces.o: maxpath.h unwind_prot.h command.h stdc.h
  1205. #  if defined (READLINE)
  1206. bracecomp.o: bracecomp.c
  1207. bracecomp.o: shell.h command.h hash.h builtins.h general.h variables.h
  1208. bracecomp.o: quit.h alias.h
  1209. bracecomp.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1210. #    if defined (HAVE_READLINE_SOURCE)
  1211. bracecomp.o: $(RL_LIBSRC)readline.h
  1212. #    endif /* HAVE_READLINE_SOURCE */
  1213. #  endif /* READLINE */
  1214. #endif /* BRACE_EXPANSION */
  1215.  
  1216. #if defined (READLINE)
  1217. bashline.o: shell.h command.h stdc.h hash.h builtins.h execute_cmd.h
  1218. bashline.o: general.h variables.h config.h memalloc.h quit.h alias.h
  1219. bashline.o: dispose_cmd.h make_cmd.h subst.h externs.h
  1220. #endif /* READLINE */
  1221.  
  1222. /* Dependencies which rely on the user using the source to READLINE. */
  1223. #if defined (READLINE) && defined (HAVE_READLINE_SOURCE)
  1224. bashline.o: $(RL_LIBSRC)chardefs.h $(RL_LIBSRC)readline.h $(RL_LIBSRC)keymaps.h
  1225. y.tab.o: $(RL_LIBSRC)keymaps.h $(RL_LIBSRC)chardefs.h $(RL_LIBSRC)readline.h
  1226. #endif /* READLINE && HAVE_READLINE_SOURCE */
  1227.  
  1228. #if defined (HISTORY) && defined (HAVE_HISTORY_SOURCE)
  1229. subst.o: $(HIST_LIBSRC)history.h
  1230. bashline.o: $(HIST_LIBSRC)history.h
  1231. y.tab.o: $(HIST_LIBSRC)history.h
  1232. #endif /* HISTORY && HAVE_HISTORY_SOURCE */
  1233.  
  1234. #if defined (USE_GLOB_LIBRARY)
  1235. subst.o: $(GLOB_LIBSRC)fnmatch.h
  1236. execute_cmd.o: $(GLOB_LIBSRC)fnmatch.h
  1237. #endif /* USE_GLOB_LIBRARY */
  1238.  
  1239. #if defined (HAVE_TILDE_SOURCE)
  1240. execute_cmd.o: $(TILDE_LIBSRC)tilde.h
  1241. general.o: $(TILDE_LIBSRC)tilde.h
  1242. mailcheck.o: $(TILDE_LIBSRC)tilde.h
  1243. shell.o: $(TILDE_LIBSRC)tilde.h
  1244. subst.o: $(TILDE_LIBSRC)tilde.h
  1245. variables.o: $(TILDE_LIBSRC)tilde.h
  1246. #endif /* HAVE_TILDE_SOURCE */
  1247.  
  1248. /* Dependencies for the shell builtins. */
  1249. builtins/common.o: shell.h command.h config.h memalloc.h general.h error.h
  1250. builtins/common.o: variables.h input.h $(DEFDIR)hashcom.h siglist.h
  1251. builtins/common.o: quit.h unwind_prot.h maxpath.h jobs.h builtins.h
  1252. builtins/common.o: dispose_cmd.h make_cmd.h subst.h externs.h bashhist.h
  1253. builtins/common.o: execute_cmd.h stdc.h
  1254. builtins/alias.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1255. builtins/alias.o: quit.h builtins/common.h
  1256. builtins/alias.o: shell.h command.h stdc.h unwind_prot.h variables.h 
  1257. builtins/alias.o: dispose_cmd.h make_cmd.h subst.h externs.h
  1258. builtins/bind.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1259. builtins/bind.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1260. builtins/bind.o: shell.h unwind_prot.h variables.h quit.h
  1261. builtins/bind.o: $(DEFDIR)bashgetopt.h
  1262. builtins/break.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1263. builtins/break.o: shell.h unwind_prot.h variables.h quit.h
  1264. builtins/break.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1265. builtins/builtin.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1266. builtins/builtin.o: quit.h $(DEFDIR)common.h
  1267. builtins/builtin.o: shell.h unwind_prot.h variables.h 
  1268. builtins/builtin.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1269. builtins/cd.o: command.h config.h memalloc.h error.h general.h maxpath.h quit.h 
  1270. builtins/cd.o: shell.h unwind_prot.h variables.h $(DEFDIR)common.h
  1271. builtins/cd.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1272. builtins/command.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1273. builtins/command.o: quit.h $(DEFDIR)bashgetopt.h
  1274. builtins/command.o: shell.h unwind_prot.h variables.h 
  1275. builtins/command.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1276. builtins/declare.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1277. builtins/declare.o: shell.h unwind_prot.h variables.h quit.h
  1278. builtins/declare.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1279. builtins/echo.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1280. builtins/echo.o: shell.h unwind_prot.h variables.h quit.h
  1281. builtins/echo.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1282. builtins/enable.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1283. builtins/enable.o: shell.h unwind_prot.h variables.h quit.h
  1284. builtins/enable.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1285. builtins/eval.o: command.h config.h memalloc.h error.h general.h maxpath.h quit.h 
  1286. builtins/eval.o: shell.h unwind_prot.h variables.h 
  1287. builtins/eval.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1288. builtins/exec.o: command.h config.h memalloc.h error.h general.h maxpath.h quit.h 
  1289. builtins/exec.o: shell.h unwind_prot.h variables.h $(DEFDIR)common.h stdc.h
  1290. builtins/exec.o: dispose_cmd.h make_cmd.h subst.h externs.h execute_cmd.h
  1291. builtins/exec.o: flags.h
  1292. builtins/exit.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1293. builtins/exit.o: shell.h unwind_prot.h variables.h quit.h
  1294. builtins/exit.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1295. builtins/fc.o: builtins.h command.h stdc.h 
  1296. builtins/fc.o: command.h config.h memalloc.h error.h general.h maxpath.h quit.h 
  1297. builtins/fc.o: flags.h unwind_prot.h variables.h shell.h 
  1298. builtins/fc.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1299. builtins/fc.o: $(DEFDIR)bashgetopt.h bashhist.h
  1300. builtins/fg_bg.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1301. builtins/fg_bg.o: shell.h unwind_prot.h variables.h quit.h
  1302. builtins/fg_bg.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1303. builtins/getopts.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1304. builtins/getopts.o: shell.h unwind_prot.h variables.h quit.h 
  1305. builtins/getopts.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1306. builtins/hash.o: builtins.h command.h execute_cmd.h stdc.h
  1307. builtins/hash.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1308. builtins/hash.o: shell.h unwind_prot.h variables.h $(DEFDIR)common.h quit.h 
  1309. builtins/help.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1310. builtins/help.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1311. builtins/help.o: shell.h unwind_prot.h variables.h quit.h
  1312. builtins/history.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1313. builtins/history.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1314. builtins/history.o: filecntl.h shell.h unwind_prot.h variables.h 
  1315. builtins/history.o: bashhist.h
  1316. builtins/inlib.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1317. builtins/inlib.o: shell.h unwind_prot.h variables.h quit.h 
  1318. builtins/inlib.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1319. builtins/jobs.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1320. builtins/jobs.o: quit.h $(DEFDIR)bashgetopt.h
  1321. builtins/jobs.o: shell.h unwind_prot.h variables.h 
  1322. builtins/jobs.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1323. builtins/kill.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1324. builtins/kill.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1325. builtins/kill.o: shell.h trap.h unwind_prot.h variables.h 
  1326. builtins/let.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1327. builtins/let.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1328. builtins/let.o: shell.h unwind_prot.h variables.h 
  1329. builtins/read.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1330. builtins/read.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1331. builtins/read.o: shell.h unwind_prot.h variables.h 
  1332. builtins/return.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1333. builtins/return.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1334. builtins/return.o: shell.h unwind_prot.h variables.h 
  1335. builtins/set.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1336. builtins/set.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h
  1337. builtins/set.o: shell.h unwind_prot.h variables.h flags.h stdc.h
  1338. builtins/setattr.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1339. builtins/setattr.o: quit.h $(DEFDIR)common.h $(DEFDIR)bashgetopt.h
  1340. builtins/setattr.o: shell.h unwind_prot.h variables.h 
  1341. builtins/setattr.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1342. builtins/shift.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1343. builtins/shift.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1344. builtins/shift.o: shell.h unwind_prot.h variables.h 
  1345. builtins/shift.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1346. builtins/source.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1347. builtins/source.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1348. builtins/source.o: shell.h unwind_prot.h variables.h 
  1349. builtins/suspend.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1350. builtins/suspend.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1351. builtins/suspend.o: shell.h unwind_prot.h variables.h 
  1352. builtins/test.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1353. builtins/test.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1354. builtins/test.o: shell.h unwind_prot.h variables.h 
  1355. builtins/times.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1356. builtins/times.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1357. builtins/times.o: shell.h unwind_prot.h variables.h 
  1358. builtins/trap.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1359. builtins/trap.o: quit.h $(DEFDIR)common.h
  1360. builtins/trap.o: shell.h unwind_prot.h variables.h 
  1361. builtins/trap.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1362. builtins/type.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1363. builtins/type.o: quit.h $(DEFDIR)common.h
  1364. builtins/type.o: shell.h unwind_prot.h variables.h execute_cmd.h
  1365. builtins/type.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1366. builtins/ulimit.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1367. builtins/ulimit.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1368. builtins/ulimit.o: shell.h unwind_prot.h variables.h 
  1369. builtins/umask.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1370. builtins/umask.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1371. builtins/umask.o: shell.h unwind_prot.h variables.h 
  1372. builtins/wait.o: command.h config.h memalloc.h error.h general.h maxpath.h
  1373. builtins/wait.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
  1374. builtins/wait.o: shell.h unwind_prot.h variables.h
  1375.  
  1376. builtins/bashgetopt.o: bashansi.h ansi_stdlib.h
  1377. builtins/mkbuiltins.o: bashansi.h ansi_stdlib.h
  1378. builtins/fc.o: bashansi.h ansi_stdlib.h
  1379.  
  1380. #if defined (READLINE) && defined (HAVE_READLINE_SOURCE)
  1381. builtins/bind.o: $(RL_LIBSRC)chardefs.h $(RL_LIBSRC)readline.h $(RL_LIBSRC)keymaps.h
  1382. #endif /* READLINE && HAVE_READLINE_SOURCE */
  1383.  
  1384. #if defined (HISTORY) && defined (HAVE_HISTORY_SOURCE)
  1385. builtins/bind.o: $(HIST_LIBSRC)history.h
  1386. builtins/fc.o: $(HIST_LIBSRC)history.h
  1387. builtins/history.o: $(HIST_LIBSRC)history.h
  1388. #endif /* HISTORY && HAVE_HISTORY_SOURCE */
  1389.  
  1390. #if defined (HAVE_TILDE_SOURCE)
  1391. builtins/common.o: $(TILDE_LIBSRC)tilde.h
  1392. builtins/cd.o: $(TILDE_LIBSRC)tilde.h 
  1393. #endif /* HAVE_TILDE_SOURCE */
  1394.  
  1395. builtins/alias.o: builtins/alias.def
  1396. builtins/bind.o: builtins/bind.def
  1397. builtins/break.o: builtins/break.def
  1398. builtins/builtin.o: builtins/builtin.def
  1399. builtins/cd.o: builtins/cd.def
  1400. builtins/colon.o: builtins/colon.def
  1401. builtins/command.o: builtins/command.def
  1402. builtins/declare.o: builtins/declare.def
  1403. builtins/echo.o: builtins/echo.def
  1404. builtins/enable.o: builtins/enable.def
  1405. builtins/eval.o: builtins/eval.def
  1406. builtins/exec.o: builtins/exec.def
  1407. builtins/exit.o: builtins/exit.def
  1408. builtins/fc.o: builtins/fc.def
  1409. builtins/fg_bg.o: builtins/fg_bg.def
  1410. builtins/getopts.o: builtins/getopts.def
  1411. builtins/hash.o: builtins/hash.def
  1412. builtins/help.o: builtins/help.def
  1413. builtins/histctl.o: builtins/histctl.def
  1414. builtins/history.o: builtins/history.def
  1415. builtins/inlib.o: builtins/inlib.def
  1416. builtins/jobs.o: builtins/jobs.def
  1417. builtins/kill.o: builtins/kill.def
  1418. builtins/let.o: builtins/let.def
  1419. builtins/read.o: builtins/read.def
  1420. builtins/reserved.o: builtins/reserved.def
  1421. builtins/return.o: builtins/return.def
  1422. builtins/set.o: builtins/set.def
  1423. builtins/setattr.o: builtins/setattr.def
  1424. builtins/shift.o: builtins/shift.def
  1425. builtins/source.o: builtins/source.def
  1426. builtins/suspend.o: builtins/suspend.def
  1427. builtins/test.o: builtins/test.def
  1428. builtins/times.o: builtins/times.def
  1429. builtins/trap.o: builtins/trap.def
  1430. builtins/type.o: builtins/type.def
  1431. builtins/ulimit.o: builtins/ulimit.def
  1432. builtins/umask.o: builtins/umask.def
  1433. builtins/wait.o: builtins/wait.def
  1434.  
  1435. $(Program).tar: $(THINGS_TO_TAR) .distribution
  1436.     @$(MKTARFILE) $(Program) `cat .distribution` $(THINGS_TO_TAR)
  1437.  
  1438. $(Program).tar$(COMPRESS_EXT):    $(Program).tar
  1439.         $(COMPRESS) < $(Program).tar > $@
  1440.  
  1441. clone:        $(THINGS_TO_TAR)
  1442.         @$(MKTARFILE) +notar $(Machine) $(OS) $(THINGS_TO_TAR)
  1443.  
  1444. install:    .made
  1445.         -if [ -f $(bindir)/$(Program) ]; \
  1446.           then mv $(bindir)/$(Program) $(bindir)/$(Program).old; \
  1447.         fi
  1448.         $(INSTALL_PROGRAM) $(Program) $(bindir)/$(Program)
  1449.         -if [ -f $(bindir)/bashbug ]; \
  1450.           then mv $(bindir)/bashbug $(bindir)/bashbug.old; \
  1451.         fi
  1452.         $(INSTALL_PROGRAM) bashbug $(bindir)/bashbug
  1453.         $(RM) installed-$(Program)
  1454.         -ln -s $(bindir)/$(Program) installed-$(Program)
  1455.         ( cd $(DOCDIR) ; $(MAKE) $(MFLAGS) mandir=$(mandir) \
  1456.             man3dir=$(man3dir) infodir=$(infodir) \
  1457.             INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
  1458.             INSTALL_DATA="${INSTALL_DATA}" $@ )
  1459.  
  1460. uninstall:    .made
  1461.         $(RM) $(bindir)/$(Program) installed-$(Program) $(bindir)/bashbug
  1462.         ( cd $(DOCDIR) ; $(MAKE) $(MFLAGS) mandir=$(mandir) man3dir=$(man3dir) infodir=$(infodir) $@ )
  1463.         
  1464. .distribution:
  1465.         ./newversion.aux -dir $(srcdir) -dist `$(Program) -c 'echo $$BASH_VERSION'`
  1466.  
  1467. distribution:    $(Program) $(Program).tar$(COMPRESS_EXT) .distribution
  1468.         @echo cp $(Program).tar$(COMPRESS_EXT) \
  1469.             $(Program)-`cat .distribution`.tar$(COMPRESS_EXT)
  1470.         @cp $(Program).tar$(COMPRESS_EXT) \
  1471.             $(Program)-`cat .distribution`.tar$(COMPRESS_EXT)
  1472.  
  1473. mailable:    distribution
  1474.         /bin/rm -rf uuencoded
  1475.         mkdir uuencoded
  1476.         $(SHELL) -c 'f=$(Program)-`cat .distribution`.tar.Z;uuencode $$f $$f | split -800 - uuencoded/$$f.uu.'
  1477.  
  1478. newversion.aux:    newversion.c
  1479.         $(CC) $(CCFLAGS) -o $@ $<
  1480.  
  1481. newversion:    newversion.aux
  1482.         $(RM) .build
  1483.         ./newversion.aux -dir $(srcdir) -dist
  1484.         mv -f newversion.h version.h
  1485.         $(MAKE) -f $(srcdir)/Makefile $(MFLAGS) srcdir=$(srcdir)
  1486.  
  1487. texindex:    force
  1488.         build_lib_in_dir($(LIBPATH)doc-support, texindex, $${topdir}/lib/doc-support, $${topdir}/lib/doc-support/Makefile)
  1489.  
  1490. documentation:  force texindex
  1491.         (cd $(DOCDIR); $(MAKE) $(MFLAGS) CFLAGS='$(CCFLAGS)')
  1492.  
  1493. force:
  1494.  
  1495. tags:        $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE)
  1496.         etags $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE)
  1497.  
  1498. TAGS:        $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE)
  1499.         ctags -x $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE) > $@
  1500.  
  1501. clean:
  1502.         $(RM) $(OBJECTS) $(Program) bashbug ansi-Makefile *.aux
  1503.         $(RM) .build .made .machine version.h
  1504.         $(RM) $(CREATED_SUPPORT) bash-Makefile
  1505.         $(RM) tags TAGS
  1506.         (cd $(DOCDIR); $(MAKE) $(MFLAGS) clean)
  1507.         (cd builtins; $(MAKE) $(MFLAGS) clean)
  1508.         $(CLEAN_READLINE) ;
  1509.         $(CLEAN_HISTORY) ;
  1510.         $(CLEAN_TERMCAP) ;
  1511.         $(CLEAN_GLOB) ;
  1512.         $(CLEAN_TILDE) ;
  1513.         $(CLEAN_MALLOC) ;
  1514.  
  1515. distclean:    clean
  1516.         $(RM) installed-bash
  1517.  
  1518. realclean:    clean
  1519.         $(RM) y.tab.c y.tab.h parser-built installed-bash
  1520.  
  1521. recho:        $(SUPPORT_SRC)recho.c
  1522.     @$(CC) -o $@ $(SUPPORT_SRC)recho.c
  1523.  
  1524. tests:        force $(Program) recho
  1525.     @cp recho tests
  1526.     ( cd tests ; sh run-all )
  1527.  
  1528. /**/# Here is a convenient rule when you arrive at a new site and wish to
  1529. /**/# install bash on several different architectures.  It creates a new
  1530. /**/# directory to hold the results of compilation.  The directory is
  1531. /**/# named Machine-OS.
  1532. architecture: $(Machine)-$(OS)/$(Program)
  1533.  
  1534. $(Machine)-$(OS):
  1535.     -mkdir $(Machine)-$(OS)
  1536.  
  1537. $(Machine)-$(OS)/$(Program): $(Machine)-$(OS) $(Program)
  1538.     mv $(Program) $(Machine)-$(OS)
  1539.     mv sysdefs.h $(Machine)-$(OS)
  1540.     mv $(SDIR)getcppsyms $(Machine)-$(OS)
  1541.     $(MAKE) $(MFLAGS) clean
  1542.  
  1543. DEFINES: config.h memalloc.h cpp-Makefile sysdefs.h
  1544.     echo $(CCFLAGS) $(CPPFLAGS) >DEFINES
  1545.